#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QCamera>
#include <QCameraViewfinder>
#include <QCameraImageCapture>
#include <QCameraInfo>
#include <QFileDialog>
#include <QDebug>
#include <QLayout>
#include <QList>
#include <QComboBox>
#include <QPushButton>
#include <QFont>
#include <QLabel>
#include <QStandardPaths>
#include <QImage>
#include <QMessageBox>

#include "showpic.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void initCamera();
private slots:
    void pushbutton_slot();
    void showbutton_slot();
    void exitbutton_slot();
    void takeImage();

private:
    Ui::MainWindow *ui;
    QString locationDir;
    QCamera *camera; //相机
    QCameraViewfinder *viewfinder; //取景器
    QCameraImageCapture *imageCapture; //图片捕获器
    QComboBox* combobox; //下拉框
    QPushButton *pushbutton_show;
    QPushButton *pushbutton_exit;
    QPushButton *pushbutton_capture; //按钮（截图
    QList<QCameraInfo> list;
    QVBoxLayout* vlayout;
    int imageCnt;

     showPic *showpic;
};
#endif // MAINWINDOW_H
